package com.maixy.studyonlineapi.exceptions;


import com.maixy.studyonlineapi.bean.State;
import com.maixy.studyonlineapi.constants.GlobalConstant;
import lombok.Getter;
import lombok.Setter;

/**
 * @Description 参数缺失异常
 * @Date 2020/7/27 18:51
 * @Created by maixy
 */
@Getter
@Setter
public class MissParamException extends RuntimeException {
    private int code;
    private String msg;

    public MissParamException() {
        this(GlobalConstant.StateCode.MISS_PARAM_EXCEPTION);
    }

    public MissParamException(State state) {
        this.code = state.getCode();
        this.msg = state.getMsg();
    }
}
